<template>
            <transition name="fade">
              <router-view class="view"></router-view>
            </transition>
</template>

<script>

import Vue from 'vue'
import Element from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
import $ from 'jquery'

Vue.use(Element)

Vue.directive('enter', {
            bind: function (el, binding, vnode) {
                const input = el.getElementsByTagName('input')[0];

                input.addEventListener('keypress', function (e) {
                    var key = e.which || e.keyCode;

                    if (key === 13) { // 13 is enter
                        // code for enter
                        el.dispatchEvent(new Event('enter'))
                    }
                })
            },
            unbind: function (el, binding, vnode) {

            }
        })
export default {
  name: 'app',
  data: function (){
    return {
      active:true,
      headerFixed : true
    }
  },
  created: function(){
    var tokenname = sessionStorage.getItem("key");
    if(tokenname===null){
    this.$router.push('/login');
    }
  },
  methods: {

  }
}
</script>

<style lang="scss">
body {
  margin: 0px;
  padding: 0px;
  /*background: url(assets/bg1.jpg) center !important;
    background-size: cover;*/
  // background: #1F2D3D;
  font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: absolute;
  top: 0px;
  bottom: 0px;
  width: 100%;
}

.el-submenu [class^=fa] {
  vertical-align: baseline;
  margin-right: 10px;
}

.el-menu-item [class^=fa] {
  vertical-align: baseline;
  margin-right: 10px;
}

.toolbar {
  background: #f2f2f2;
  padding: 10px;
  //border:1px solid #dfe6ec;
  margin: 10px 0px;
  .el-form-item {
    margin-bottom: 10px;
  }
}

.fade-enter-active,
.fade-leave-active {
  transition: all .2s ease;
}

.fade-enter,
.fade-leave-active {
  opacity: 0;
}
</style>